{% extends "moban1788/base.html" %}
{% block head %}
    <script>
        $(document).ready(function(){
            $("#encryption").click(function(){
                var encry = $("#encry").val();
                if (encry == ''){
                    sweetAlert("", "加密内容不能为空,请输入加密数据", "info");
                    return false;
                }
            });
             $("#decrypta").click(function(){
                var  decry= $("#decry").val();
                if (decry == ''){
                    sweetAlert("", "解密内容不能为空,请输入解密数据", "info");
                    return false;
                }
            });
            $("#encryption1").click(function(){
                var encry = $("#encry1").val();
                if (encry == ''){
                    sweetAlert("", "加密内容不能为空,请输入加密数据", "info");
                    return false;
                }
            });
             $("#decrypta1").click(function(){
                var  decry= $("#decry1").val();
                if (decry == ''){
                    sweetAlert("", "解密内容不能为空,请输入解密数据", "info");
                    return false;
                }
            });
        });
    </script>
{% endblock %}
{% block main %}
<div class="page-title cart-title">
  <div class="container-fluid">
    <div class="row">
        <form method= 'get'>
            <br>
            <div class="col-lg-6" style="margin-top: 12%">

                <div class="col-md-6">
                    <select name="is_online" id="is_online" class="form-control" style=" width: 80%;">
                        <option value=0>测试环境</option>
                        <option value=1>线上环境</option>
                    </select>
                </div>
                <div class="col-md-6">
                    <select name="is_get" id="is_get" class="form-control" style="width: 80%">
                        <option value=1>POST请求</option>
                        <option value=0>GET请求</option>
                    </select>
                </div>
                <div class="col-md-6" style="margin-top: 2%">
                    <input name="data_post" id="data_post" class="input-sm" style="width: 80%;" placeholder="POST数据">&nbsp;&nbsp;选择POST选项,该项必填
                </div>
                <div class="col-md-6" style="margin-top: 2%">
                    <input name="num" id="num" class="input-sm" style="width: 30%;" placeholder="数量">&nbsp;&nbsp;<b style="color: white">线上/测试({{ count_online }}/{{ count_test }})</b>
                </div>
                <div class="col-md-6" style="margin-top: 2%">
                    <input name="gest_uid" id="gest_uid" class="input-sm" style="width: 30%;" placeholder="个数">&nbsp;&nbsp;变量个数
                    <input type="submit" id="button" name="button" class="btn btn-info" style="width: 40%; margin-left: -20%" value="确定"/>&nbsp;&nbsp;
                </div>
                <div class="col-md-6" style="margin-top: -5%">
                    <input name="url" id="url" class="input-sm" style="width: 80%;" placeholder="请输入URL" >&nbsp;&nbsp;
                </div>
                <div class="col-md-3" style="margin-top: 2%">
                    <input name="all_num" id="all_num" class="input-sm" style="width: 30%;">&nbsp;&nbsp;<b style="color: white">会话数</b>
                </div>
                <div class="col-md-3" style="margin-top: 2%">
                    <input name="connect_num" id="connect_num" class="input-sm" style="width: 30%;">&nbsp;&nbsp;<b style="color: white">消息数</b>
                </div>
                <div class="col-md-4" style="margin-top: 2%">
                    <input name="uid" id="uid" class="input-sm" style="width: 50%;">&nbsp;&nbsp;<b style="color: white">接收uid</b>
                </div>

            </div>
        </form>
        <br>
        <div class="col-lg-6">
            <div style="text-align: left">
                <p style="position:relative;width: 100%;height: auto; overflow-x:auto">
                    <textarea class="form-control" style="width: 95%;min-height: 400px;margin-top: 2%; disabled: disabled">{{ result }}</textarea>
                </p>
            </div>
        </div>
    </div>
  </div>
</div>
<section class="pt-150">
    <div class="container">
        <div class="row">
            <div class="col-md-12 text-center">
                <h1 class="text-uppercase ls-3 bb gray-de"><span class="yellow"> 用户</span> 操作历史</h1>
                <p class="mt-50 fz-15">
                    记录用户运行接口发射器时的每次操作记录.
                </p>
            </div>
        </div>
        <div class="row" style="margin-bottom: 2%">
          <div class="col-md-12">
            <div class="table-responsive mt-70">
              <table class="table my-cart no-margin">
                <thead>
                  <tr>
                    <th class="col-lg-1">#</th>
                    <th class="col-lg-1">环境</th>
                    <th class="col-lg-1 ">请求</th>
                    <th class="col-lg-6">请求url</th>
                    <th class="col-lg-1">数量</th>
                    <th class="col-lg-2">时间</th>
                </tr>
                </thead>
                <tbody>
                    {% for show in history_list.object_list %}
                        <tr>
                            <td>{{ show.id }}</td>
                            {% if show.is_online == 1 %}
                            <td>线上</td>
                            {% else %}
                            <td style="text-align: center;vertical-align:middle">测试</td>
                            {% endif %}
                            {% if show.is_post == 1 %}
                                <td>POST</td>
                            {% else %}
                                <td>GET</td>
                            {% endif %}
                            <td>{{ show.url }}</td>
                            <td>{{ show.number }}</td>
                            <td>{{ show.time }}</td>
                        </tr>
                    {% empty %}
                        <tr>
                            暂无数据
                        </tr>
                    {% endfor %}
                </tbody>
              </table>
            <div class="row col-lg-12" style="text-align: center; margin-top: 2%">
                <span class="step-links">
                    <ul class="pager">
                     {% if history_list.has_previous %}
                     <li class="prev">
                         <a href="?page={{ history_list.previous_page_number }}" class="previous" style="font-size: 14px">上一页</a>
                     </li>
                     {% endif %}
                     第 {{ history_list.number }}/{{ history_list.paginator.num_pages }} 页
                     {% if history_list.has_next %}
                         <li class="prev">
                             <a href="?page={{ history_list.next_page_number }}" style="font-size: 14px">下一页</a>
                         </li>
                     {% endif %}
                        <li class="next"><a style="font-size: 14px">共{{ history.count }}条</a>
                    </ul>
                </span>
            </div>
            </div>
          </div>
        </div>
    </div>
</section>
{% endblock %}
{% block js %}
    <script src="../../../qa/static/js/plugins/morris/raphael.min.js"></script>
    <script src="../../../qa/static/js/plugins/morris/morris.min.js"></script>
    <script src="../../../qa/static/js/plugins/morris/morris-data.js"></script>
    <script src="../../../qa/static/js/sweet-alert.min.js"></script>
    <link rel="stylesheet" type="text/css" href="../../../qa/static/css/sweet-alert.css">
    <script src="../../../qa/static/js_new/jquery-1.12.4.min.js"></script>
    <script src="../../../qa/static/js_new/bootstrap.min.js"></script>
{% endblock %}